<?php
/**
 * Created by PhpStorm.
 * User: albert
 * Date: 18-5-8
 * Time: 下午5:38
 */

namespace apis\base;

use Yii;

class Module extends \yii\swoole\Module
{
    public function init()
    {
        parent::init();
        $this->registerTranslations();
    }

    public function registerTranslations()
    {
        $path = Yii::$app->BaseHelper->getPath($this);
        Yii::$app->i18n->translations[$this->id] = [
            'class' => 'yii\i18n\PhpMessageSource',
            'sourceLanguage' => Yii::$app->sourceLanguage,
            'basePath' => '@apis' . $path . '/messages'
        ];
    }
}